<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="ketwords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="java">

</head>
<body>登录名：${loginUser.username}
	<form method="post" action="${pageContext.request.contextPath}/user/manager?func=update" onsubmit="return validate(this)">
	<input type="hidden" name="id" value="${loginUser.id }">
		用户名:<input type="text" name="username" value=${loginUser.username} readonly><br>
		原密码:<input type="password" name="opassword"><br>
		新密码:<input type="password" name="npassword"><br>
		确认密码:<input type="password" name="rpassword"><br>
		<input type="submit" name="submit" value="确定">
	</form>
</body>

<script type="text/javascript">
 function validate(f){
    if(f.opassword.value.length==0){
      alert("请输入原密码！");
      f.opassword.focus();
      return false;
     }
    if(f.opassword.value!="${loginUser.password}"){
      alert("原密码不正确！");
      f.opassword.focus();
      return false;
     }
    if(f.password.value.length<4){
      alert("新密码长度必须4以上！");
      f.password.focus();
      return false;
     }   
    if(f.password.value!=f.rpassword.value){
      alert("新密码和确认密码不一致！");
      f.password.focus();
      return false;
     }  
    }
</script>

</html>